﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DevExpress.Xpo;

namespace WROA.Models.Entitys
{
    public class Users : XPObject
    {
        private string u_name;
        [DbType("nvarchar(50)")]
        public string U_name { get; set; }

        
        private string u_password;
        [DbType("nvarchar(50)")]
        public string U_password { get; set; }

        private string u_realname;
        [DbType("nvarchar(50)")]
        public string U_realname { get; set; }

        private string u_gender;
        [DbType("nvarchar(50)")]
        public string U_gender { get; set; }
        
        private string u_email;
        [DbType("nvarchar(50)")]
        public string U_email { get; set; }

        
        private string u_phone;
        [DbType("nvarchar(50)")]
        public string U_phone { get; set; }

        private string u_mobile;
        [DbType("nvarchar(50)")]
        public string U_mobile { get; set; }

        
        private DateTime u_birth;
        [DbType("datetime")]
        public DateTime U_birth { get; set; }

        
        private DateTime u_registdate;
        [DbType("datetime")]
        public DateTime U_registdate { get; set; }

        private Role role;   //角色编号
        [Association("RoleUser")]
        public Role Role
        {
            get { return role; }
            set { role = value; }
        }

        private Position position;   //职位编号
        [Association("PositionUser")]
        public Position Position
        {
            get { return position; }
            set { position = value; }
        }

        [Association("FlowUser", typeof(Flow))]
        public XPCollection flows
        {
            get
            {
                return GetCollection("flows");
            }
        }

        [Association("ApplyDocumentUser", typeof(ApplyDocument))]
        public XPCollection ApplyDocuments
        {
            get
            {
                return GetCollection("ApplyDocuments");
            }
        }

        [Association("FileUser", typeof(File))]
        public XPCollection files
        {
            get
            {
                return GetCollection("files");
            }
        }

        [Association("DocumentApproveUser", typeof(DocumentApprove))]
        public XPCollection documentapproves
        {
            get
            {
                return GetCollection("documentapproves");
            }
        }

        [Association("ApplyMeetingUser", typeof(ApplyMeeting))]
        public XPCollection applymeetings
        {
            get
            {
                return GetCollection("applymeetings");
            }
        }

        [Association("MeetingApproveUser", typeof(MeetingApprove))]
        public XPCollection meetingapproves
        {
            get
            {
                return GetCollection("meetingapproves");
            }
        }

        private Car car;
        public Car Car { get; set; }

        [Association("ApplyCarUser", typeof(ApplyCar))]
        public XPCollection applycars
        {
            get
            {
                return GetCollection("applycars");
            }
        }

        [Association("CarApproveUser", typeof(CarApprove))]
        public XPCollection carapproves
        {
            get
            {
                return GetCollection("carapproves");
            }
        }

        [Association("MeetingUserUser", typeof(MeetingUser))]
        public XPCollection meetingusers
        {
            get
            {
                return GetCollection("meetingusers");
            }
        }

        [Association("PassengerUsers", typeof(Passenger))]
        public XPCollection passengers
        {
            get
            {
                return GetCollection("passengers");
            }
        }
    }

}